package com.jcl.recruit.basic.login.model;

import java.util.HashMap;

/**
 * @ClassName LoginResultContent
 * @Author yyliu
 * @Date 2018/12/17 10:34
 * @Version 1.0
 **/
public class LoginResultContent {

    public static final String SUCCESS_CODE = "ACCOUNT-20000";
    public static final String ACCOUNT_ERROR_CODE = "ACCOUNT-20001";
    private static final String SUCCESS_MSG = "登录成功";
    private static final String ACCOUNT_ERROR_MSG = "账户密码有误";

    private static HashMap<String, String> result_content = new HashMap<>();

    static {
        result_content.put(SUCCESS_CODE, SUCCESS_MSG);
        result_content.put(ACCOUNT_ERROR_CODE, ACCOUNT_ERROR_MSG);
    }

    public static String getMsg(String code) {
        return result_content.get(code);
    }

    public static Boolean hasError(String code){
        return !SUCCESS_CODE.equals(code) ? true : false;
    }
}
